#include <cstdio>

void swap(int &a, int &b) {
	int temp = a;
	a = b;
	b = temp;
}

bool isLeap(int year) {
	return ( year & 400 == 0 || ( year % 4 == 0 && year % 100 != 0 ) );
}

int main() {
	int year1, year2;
	int month1, month2;
	int day1, day2;
	int dif = 0;
	bool isL = false;
	int days[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

	scanf("%4d%2d%2d", &year1, &month1, &day1);
	scanf("%4d%2d%2d", &year2, &month2, &day2);

	if (year1 > year2) {
		swap(year1, year2);
		swap(month1, month2);
		swap(day1, day2);
	}

	while ( year1 != year2 && month1 != month2 && day1 != day2 ) {
		if (isLeap(year1)) days[1] = 29;
		else days[1] = 28;

		++day1;
		++dif;
		if ( day1 % (days[month1]+1) == 0 ) {
			day1 = 1;
			++month1;
		}
		if ( month1 % (13) == 0 ) {
			month1 = 1;
			++year1;
		}
	}

	printf("%d\n", dif+1);

	return 0;
}